unit UCtrlMarca;

interface

    uses
        db, UController, UDaoMarca;
    type
        CtrlMarca = class (Controller)

protected
    umaDaoMarca : DaoMarca;
public
    constructor Create;
    destructor Destroy;
    function Salvar (obj : TObject) : string;     override;
    function getDs : TDataSource;                 override;
    function Carrega (obj : Tobject) : Tobject ;  override;
    function Excluir (obj : Tobject) : String ;   override;
    function Buscar (chave : string) : boolean ;  override;
    function Editar (obj: Tobject)   : string;    override;
    function existe(dado:string):Boolean;         override;
end;

implementation

{ CtrlMarca }

function CtrlMarca.Buscar(chave: string): boolean;
begin
   Result := umaDaoMarca.Buscar(chave);
end;

function CtrlMarca.Carrega(obj: Tobject): Tobject;
begin
   Result := umaDaoMarca.Carrega(obj);
end;

constructor CtrlMarca.Create;
begin
    inherited;
    umaDaoMarca := daoMarca.Create;
end;

destructor CtrlMarca.Destroy;
begin
    inherited;
    umaDaoMarca.Destroy;
end;

function CtrlMarca.Editar(obj: Tobject): string;
begin
    Result := umaDaoMarca.editar(obj);
end;

function CtrlMarca.Excluir(obj: Tobject): String;
begin
    Result := umaDaoMarca.Excluir(obj);
end;

function CtrlMarca.existe(dado: string): Boolean;
begin

end;

function CtrlMarca.getDs: TDataSource;
begin
   Result := umaDaoMarca.GetDS;
end;

function CtrlMarca.Salvar(obj: TObject): string;
begin
   Result := umaDaoMarca.salvar(obj);
end;

end.

